package cn.t222.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class SysResources implements Serializable {
    public static final int TYPE_MENU = 0;
    public static final int TYPE_BUTTON_TABLE = 1;
    public static final int TYPE_BUTTON_FORM = 2;
    public static final int TYPE_FUNCTION = 3;
    private Integer id;
    private Integer pid;
    private String name;
    private String title;
    private String url;
    private Integer type; // 0-菜单，1-按钮，2-功能
    private List<SysResources> childrenList;

    @Override
    public int hashCode() {
        return id.hashCode();
    }
    @Override
    public boolean equals(Object o) {
        if(this == o) return true;
        if(o == null) return false;
        if(getClass() != o.getClass()) return false;
        SysResources other = (SysResources) o;
        return other.getId().equals(id);
    }
}
